package com.atguigu.spzx.manager.util;

import com.atguigu.spzx.manager.properties.SpzxMinioProperties;
import io.minio.MinioClient;

public class MinioUtil {
    private static MinioClient minioClient;
    private MinioUtil(){}
    static{
        minioClient = MinioClient
                .builder() //获取MinioClient的构建器
                .endpoint(SpzxMinioProperties.ENDPOINT) //地域节点：minio服务端地址(协议+ip+端口)
                .credentials(SpzxMinioProperties.ACCESS_KEY, SpzxMinioProperties.SECRET_KEY) //连接Minio的账号密码
                .build();//构建MinioClient对象
    }
    public static MinioClient build(){
        return minioClient;
    }

}
